#include "my_systick.h"
#include "Global.h"

volatile unsigned long DelayTime;
SystickIqrfunc pSystickIqrfunc=NULL;

void systick_config(SystickIqrfunc pFunc)
{
	SysTick_Config(SYSTEMTICK_CLK); 
  
  pSystickIqrfunc = pFunc;
}

void Systick_Delay(unsigned long nTime)
{
	DelayTime = nTime;

	while(DelayTime != 0);
}

void TimingDelay(void)
{
	if(DelayTime != 0)
	{
		DelayTime--;
	}
}

void Systick_Irq_Handler(void)
{
  if(NULL != pSystickIqrfunc)
  {
    pSystickIqrfunc();
  }
}



